<div class="form-group{{if .Error}} has-error{{end}}">
    <div class="btn-toolbar md-toolbar" role="toolbar">
        <div class="btn-group">
            <button type="button" class="btn btn-default md-btn" data-meta="preview"><i class="icon-eye-open"></i> {{i18n $.root.Lang "post.preview"}}</button>
        </div>
        <div class="btn-group">
            <button type="button" class="btn btn-default md-btn" data-meta="image" data-placement="bottom"><i class="icon-picture"></i></button>
            <button type="button" class="btn btn-default md-btn" data-meta="code"><i class="icon-code"></i></button>
        </div>
        <div class="btn-group">
            <button type="button" class="btn btn-default md-btn disabled" data-meta="undo"><div class="icon-rotate-left"></div></button>
            <button type="button" class="btn btn-default md-btn disabled" data-meta="redo"><i class="icon-rotate-right"></i></button>
        </div>
    </div>
    <div class="md-textarea">
        {{call .Field}}
        {{if .Error}}<p class="error-block">{{.Error}}</p>{{end}}
        {{if .Help}}<p class="help-block">{{.Help}}</p>{{end}}
    </div>
</div>
<div class="md-preview markdown" style="display:none;">
</div>

{{str2html `<script type="text/template" rel="image-popover-title">`}}
    {{i18n $.root.Lang "editor.insert_image"}}
    <a class="pull-right color-link" rel="image-upload" href="javascript:"><i class="icon-upload-alt"></i> {{i18n $.root.Lang "editor.upload_image"}}</a>
{{str2html `</script>`}}

{{str2html `<script type="text/template" rel="image-popover-content">`}}
    <div class="md-image">
        <form class="md-image-form" style="display:none;" action="{{$.root.AppUrl}}upload" data-dismiss="upload" enctype="multipart/form-data" method="POST">
            <div style="display:none" class="alert alert-danger alert-small" data-message="{{i18n $.root.Lang "editor.upload_failed"}}"></div>
            <div style="display:none" class="alert alert-success alert-small">{{i18n $.root.Lang "editor.upload_success"}}</div>
            <input type="hidden" name="type" value="image">
            <div class="form-group">
                <input class="form-control" type="text" disabled="disabled" rel="filename">
                <input style="width:0;height:0;position:fixed;top:9999px;left:9999px;" type="file" name="image">
            </div>
            <div class="form-group">
                <div class="text-center">
                    <span class="btn-group">
                        <button class="btn btn-default" type="button" rel="button">{{i18n $.root.Lang "editor.upload_select"}}</button>
                        <button class="btn btn-default" type="submit">{{i18n $.root.Lang "editor.upload_now"}}</button>
                    </span>
                </div>
            </div>
        </form>
        <div class="form-group">
            <label class="control-label">{{i18n $.root.Lang "editor.image_link"}}</label>
            <input class="form-control" type="text" name="link" placeholder="{{i18n $.root.Lang "editor.plz_enter_image_link"}}">
        </div>
        <button class="btn btn-info btn-block" type="button" rel="image-insert">
            {{i18n $.root.Lang "editor.insert"}}
        </button>
    </div>
{{str2html `</script>`}}